//
//  YDTextView.swift
//  weibo
//
//  Created by 孙亚东 on 16/6/30.
//  Copyright © 2016年 Sunyadong. All rights reserved.
//

import UIKit

class YDTextView: UITextView {

    
    override init(frame: CGRect, textContainer: NSTextContainer?) {
        
        super.init(frame: frame, textContainer: textContainer)
        
        
        //当拖动的时候，键盘退出

        setupUI()
        
        
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
        
        
    }
    
    func setupUI() {
    
        backgroundColor = UIColor.whiteColor()
        
        addSubview(textLab)

        
        
       // 设置约束
        textLab.snp_makeConstraints { (make) -> Void in
            
            make.top.equalTo(self.snp_top).offset(6)
            make.left.equalTo(self.snp_left).offset(2)
            
            
        }
        
        
    }
    
    // 懒加载添加一个lab
     lazy var textLab: UILabel = {
    
        var lab = UILabel()
        
        lab.text = "你大爷永远是你大爷"
        lab.textColor = UIColor.grayColor()
        
        

        return lab
    
    }()
    


}
